Skip to content

[Fizz] Abort tasks that suspend after aborting during render#36585

Merged
gnoff merged 1 commit into
facebook:mainfrom
gnoff:jstory/abort-suspended-after-abort
Jun 1, 2026
Merged

[Fizz] Abort tasks that suspend after aborting during render#36585
gnoff merged 1 commit into
facebook:mainfrom
gnoff:jstory/abort-suspended-after-abort

Conversation

@gnoff
Copy link
Copy Markdown
Collaborator

@gnoff gnoff commented May 31, 2026

Stacked on #36580

When a task calls abort() while it is rendering, Fizz intentionally leaves that task alone during the synchronous abort sweep so it can unwind normally. If the task then suspends before reaching a normal abort check, however, it currently remains pending and does not report the abort reason.

This change completes an aborted task once it has unwound back to the retry loop. Instead of treating it as an ordinary render error, it is routed through the existing abort task completion path so prerenders continue to postpone aborted work correctly and replay tasks use aborted resume semantics.

If the task suspended through use(), preserve its thenable state before completing the abort. This allows DEV async debug info to replay the suspended call site and include it in the owner stack, even though the task began aborting before it suspended.

Add coverage for render, prerender, and resumed replay tasks that suspend after initiating an abort, including a real-timer test verifying the suspended call site is retained in DEV owner stacks.

@meta-cla meta-cla Bot added the CLA Signed label May 31, 2026
@gnoff gnoff requested review from eps1lon and unstubbable May 31, 2026 18:52
@github-actions github-actions Bot added the React Core Team Opened by a member of the React Core Team label May 31, 2026
@react-sizebot
Copy link
Copy Markdown

react-sizebot commented May 31, 2026

Comparing: 3c882b4...680183a

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.js = 6.84 kB 6.84 kB = 1.88 kB 1.88 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 614.26 kB 614.26 kB = 108.57 kB 108.57 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.84 kB 6.84 kB = 1.88 kB 1.88 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 680.19 kB 680.19 kB = 119.51 kB 119.51 kB
facebook-www/ReactDOM-prod.classic.js = 700.61 kB 700.61 kB = 123.09 kB 123.09 kB
facebook-www/ReactDOM-prod.modern.js = 690.93 kB 690.93 kB = 121.48 kB 121.48 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable-semver/react-server/cjs/react-server.production.js +0.23% 148.43 kB 148.77 kB +0.15% 26.06 kB 26.10 kB
oss-stable/react-server/cjs/react-server.production.js +0.23% 148.43 kB 148.77 kB +0.15% 26.06 kB 26.10 kB
oss-experimental/react-server/cjs/react-server.production.js +0.22% 151.97 kB 152.31 kB +0.16% 26.84 kB 26.89 kB

Generated by 🚫 dangerJS against 680183a

When a task calls `abort()` while it is rendering, Fizz intentionally leaves that task alone during the synchronous abort sweep so it can unwind normally. If the task then suspends before reaching a normal abort check, however, it currently remains pending and does not report the abort reason.

This change completes an aborted task once it has unwound back to the retry loop. Instead of treating it as an ordinary render error, it is routed through the existing abort task completion path so prerenders continue to postpone aborted work correctly and replay tasks use aborted resume semantics.

If the task suspended through `use()`, preserve its thenable state before completing the abort. This allows DEV async debug info to replay the suspended call site and include it in the owner stack, even though the task began aborting before it suspended.

Add coverage for render, prerender, and resumed replay tasks that suspend after initiating an abort, including a real-timer test verifying the suspended call site is retained in DEV owner stacks.
@gnoff gnoff force-pushed the jstory/abort-suspended-after-abort branch from ff809d4 to 680183a Compare June 1, 2026 14:49
@gnoff gnoff merged commit 557e28f into facebook:main Jun 1, 2026
462 of 463 checks passed
github-actions Bot pushed a commit that referenced this pull request Jun 1, 2026
Stacked on #36580

When a task calls `abort()` while it is rendering, Fizz intentionally
leaves that task alone during the synchronous abort sweep so it can
unwind normally. If the task then suspends before reaching a normal
abort check, however, it currently remains pending and does not report
the abort reason.

This change completes an aborted task once it has unwound back to the
retry loop. Instead of treating it as an ordinary render error, it is
routed through the existing abort task completion path so prerenders
continue to postpone aborted work correctly and replay tasks use aborted
resume semantics.

If the task suspended through `use()`, preserve its thenable state
before completing the abort. This allows DEV async debug info to replay
the suspended call site and include it in the owner stack, even though
the task began aborting before it suspended.

Add coverage for render, prerender, and resumed replay tasks that
suspend after initiating an abort, including a real-timer test verifying
the suspended call site is retained in DEV owner stacks.

DiffTrain build for [557e28f](557e28f)
github-actions Bot pushed a commit to igoreshkafirst/react that referenced this pull request Jun 1, 2026
…k#36585)

Stacked on facebook#36580

When a task calls `abort()` while it is rendering, Fizz intentionally
leaves that task alone during the synchronous abort sweep so it can
unwind normally. If the task then suspends before reaching a normal
abort check, however, it currently remains pending and does not report
the abort reason.

This change completes an aborted task once it has unwound back to the
retry loop. Instead of treating it as an ordinary render error, it is
routed through the existing abort task completion path so prerenders
continue to postpone aborted work correctly and replay tasks use aborted
resume semantics.

If the task suspended through `use()`, preserve its thenable state
before completing the abort. This allows DEV async debug info to replay
the suspended call site and include it in the owner stack, even though
the task began aborting before it suspended.

Add coverage for render, prerender, and resumed replay tasks that
suspend after initiating an abort, including a real-timer test verifying
the suspended call site is retained in DEV owner stacks.

DiffTrain build for [557e28f](facebook@557e28f)
github-actions Bot pushed a commit to thought7878/react that referenced this pull request Jun 2, 2026
…k#36585)

Stacked on facebook#36580

When a task calls `abort()` while it is rendering, Fizz intentionally
leaves that task alone during the synchronous abort sweep so it can
unwind normally. If the task then suspends before reaching a normal
abort check, however, it currently remains pending and does not report
the abort reason.

This change completes an aborted task once it has unwound back to the
retry loop. Instead of treating it as an ordinary render error, it is
routed through the existing abort task completion path so prerenders
continue to postpone aborted work correctly and replay tasks use aborted
resume semantics.

If the task suspended through `use()`, preserve its thenable state
before completing the abort. This allows DEV async debug info to replay
the suspended call site and include it in the owner stack, even though
the task began aborting before it suspended.

Add coverage for render, prerender, and resumed replay tasks that
suspend after initiating an abort, including a real-timer test verifying
the suspended call site is retained in DEV owner stacks.

DiffTrain build for [557e28f](facebook@557e28f)
github-actions Bot pushed a commit to thought7878/react that referenced this pull request Jun 2, 2026
…k#36585)

Stacked on facebook#36580

When a task calls `abort()` while it is rendering, Fizz intentionally
leaves that task alone during the synchronous abort sweep so it can
unwind normally. If the task then suspends before reaching a normal
abort check, however, it currently remains pending and does not report
the abort reason.

This change completes an aborted task once it has unwound back to the
retry loop. Instead of treating it as an ordinary render error, it is
routed through the existing abort task completion path so prerenders
continue to postpone aborted work correctly and replay tasks use aborted
resume semantics.

If the task suspended through `use()`, preserve its thenable state
before completing the abort. This allows DEV async debug info to replay
the suspended call site and include it in the owner stack, even though
the task began aborting before it suspended.

Add coverage for render, prerender, and resumed replay tasks that
suspend after initiating an abort, including a real-timer test verifying
the suspended call site is retained in DEV owner stacks.

DiffTrain build for [557e28f](facebook@557e28f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants